home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Sample Code / AOCE Sample Code / SampleTemplate / Sample Template / Source / AlbumCollection.r < prev    next >
Encoding:
Text File  |  1994-06-23  |  6.3 KB  |  219 lines  |  [TEXT/MPS ]

  1. #include "Types.r"
  2. #include "OCETemplates.h"
  3. #include "OCE.r"
  4.  
  5. #define kCollectionAspect        (kDETFifthID + (3 * kDETIDSep))
  6. #define kCollectionInfoPage        (kDETFifthID + (4 * kDETIDSep))
  7.  
  8. #define kGeneva 3
  9. #define kPalatino 16
  10. #define kSystemFont 0
  11.  
  12. // Page layout defines:
  13.  
  14. #define iconColumnWidth            16
  15. #define nameColumnWidth            132
  16. #define kindColumnWidth            86
  17. #define spaceBetweenColumns        2
  18.  
  19. #define iconColumnLeft            0
  20. #define iconColumnRight            (iconColumnLeft + iconColumnWidth)
  21. #define nameColumnLeft            (iconColumnRight + spaceBetweenColumns)
  22. #define nameColumnRight            (nameColumnLeft + nameColumnWidth)
  23. #define kindColumnLeft            nameColumnRight
  24. #define kindColumnRight            (kindColumnLeft + kindColumnWidth)
  25.  
  26. #define sublistIconTop            (-7)
  27. #define sublistIconBottom        (9)
  28. #define sublistTextTop            (-6)
  29. #define sublistTextBottom        (8)
  30. #define sublistTitleTop            35
  31. #define sublistTitleBottom        (sublistTitleTop+12)
  32.  
  33. #define windowHeight            280
  34. #define windowWidth                (kindColumnLeft+kindColumnWidth+15+16)
  35.  
  36. #define sublistTopBound            (sublistTitleBottom+2)
  37. #define sublistBottomBound        (windowHeight-12)
  38. #define sublistLeftBound        12
  39. #define sublistRightBound        (windowWidth-12)
  40.  
  41. #define kPageBitmapLeft            (11)
  42. #define kPageBitmapRight        (kPageBitmapLeft+16)
  43. #define kPageBitmapTop            7
  44. #define kPageBitmapBottom        23
  45.  
  46.  
  47.  
  48. // Here's an example using a single aspect as both
  49. // the main aspect and the info page aspect
  50. resource 'deta' (kCollectionAspect, purgeable) {
  51.     0,                    // Drop priority
  52.     dropCheckConflicts,    // Drop check flag
  53.     isMainAspect        // Is the main aspect
  54. };
  55.  
  56. resource 'rstr' (kCollectionAspect+kDETTemplateName, purgeable) {
  57.     "Album Collection Aspect"
  58. };
  59.  
  60. resource 'rstr' (kCollectionAspect+kDETRecordType, purgeable) {
  61.     "Album Collection"
  62. };
  63.  
  64. resource 'rstr' (kCollectionAspect+kDETAspectKind, purgeable) {
  65.     "album collection"
  66. };
  67.  
  68. resource 'rstr' (kCollectionAspect+kDETAspectWhatIs, purgeable) {
  69.     "Album Collection\n\nA collection of albums."
  70. };
  71.  
  72. resource 'rstr' (kCollectionAspect+kDETAspectAliasKind, purgeable) {
  73.     "album collection alias"
  74. };
  75.  
  76. resource 'rstr' (kCollectionAspect+kDETAspectAliasWhatIs, purgeable) {
  77.     "Album Collection alias\n\This is an alias to a collection of albums."
  78. };
  79.  
  80. resource 'rst#' (kCollectionAspect+kDETAspectCategory,purgeable)
  81.     {{
  82.     "Recordings"
  83.     }};
  84.  
  85. resource 'detw' (kCollectionAspect+kDETAspectInfoPageCustomWindow, purgeable) {
  86.     { 0, 0, windowHeight, windowWidth },
  87.     discludePopup
  88. };
  89.  
  90. resource 'detv' (kCollectionAspect+kDETAspectInfoPageCustomWindow, purgeable)
  91.     {
  92.     {
  93.     {6, kPageBitmapRight+8, 25, kPageBitmapRight+8+166}, kDETNoFlags, kDETInfoPageNumber,
  94.         Menu {kSystemFont, 12, kDETLeft, kDETNormal, "", kDETInfoPageNumber, kDETInfoPageNumber };
  95.     };
  96.     };
  97.  
  98. resource 'rstr' (kCollectionAspect+kDETAspectNewMenuName, purgeable) {
  99.     "New Album Collection"
  100. };
  101.  
  102. resource 'rstr' (kCollectionAspect+kDETAspectNewEntryName, purgeable) {
  103.     "untitled album collection"
  104. };
  105.  
  106. include "AlbumCollectionIcons" 'ICN#'(0) as 'ICN#'(kCollectionAspect+kDETAspectMainBitmap, purgeable);
  107. include "AlbumCollectionIcons" 'icl4'(0) as 'icl4'(kCollectionAspect+kDETAspectMainBitmap, purgeable);
  108. include "AlbumCollectionIcons" 'icl8'(0) as 'icl8'(kCollectionAspect+kDETAspectMainBitmap, purgeable);
  109. include "AlbumCollectionIcons" 'ics#'(0) as 'ics#'(kCollectionAspect+kDETAspectMainBitmap, purgeable);
  110. include "AlbumCollectionIcons" 'ics4'(0) as 'ics4'(kCollectionAspect+kDETAspectMainBitmap, purgeable);
  111. include "AlbumCollectionIcons" 'ics8'(0) as 'ics8'(kCollectionAspect+kDETAspectMainBitmap, purgeable);
  112. include "AlbumCollectionIcons" 'SICN'(0) as 'SICN'(kCollectionAspect+kDETAspectMainBitmap, purgeable);
  113.  
  114.  
  115. resource 'rstr' (kCollectionAspect+kDETAspectDragInString, purgeable) {
  116.     "Do you want to add %3%“^3”%the selected items% to *0x/the/* ^1 “^2”?"
  117. };
  118.  
  119. resource 'rst#' (kCollectionAspect+kDETAspectRecordCatDragIn,purgeable)
  120.     {{
  121.     "Recordings", kMemberAttrTypeBody
  122.     }};
  123.  
  124. resource 'rst#' (kCollectionAspect+kDETAspectAttrDragIn,purgeable)
  125.     {{
  126.     "", kMemberAttrTypeBody, kMemberAttrTypeBody
  127.     }};
  128.  
  129. resource 'dett' (kCollectionAspect+kDETAspectLookup, purgeable)
  130.     {{
  131.     {kMemberAttrTypeBody}, typePackedDSSpec,
  132.         notForInput, notForOutput, useInSublist, isAlias, isNotRecordRef,
  133.         {};
  134.     }};
  135.  
  136. resource 'detm' (kCollectionAspect+kDETAspectViewMenu, purgeable)
  137.     {
  138.     kCollectionAspect+kDETAspectViewMenu,
  139.     {
  140.     kDETPrName, "by Name";
  141.     kDETPrKind, "by Kind";
  142.     }
  143.     };
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. // The info-page:
  153.  
  154. #define k2ndColumnRightInset            (kDETRecordInfoWindWidth-kDETSubpageRightInset)
  155.  
  156.  
  157. resource 'deti' (kCollectionInfoPage, purgeable) {
  158.     1000,
  159.     {sublistTopBound, sublistLeftBound, sublistBottomBound, sublistRightBound},
  160.     noSelectFirstText,
  161.     {
  162.     kDETNoProperty, kDETNoProperty, kCollectionInfoPage;
  163.     },
  164.     {
  165.     kDETNoProperty, kDETNoProperty, kCollectionInfoPage + 1;
  166.     }};
  167.  
  168. resource 'rstr' (kCollectionInfoPage+kDETTemplateName, purgeable) {
  169.     "Album Collection Info Page"
  170. };
  171.  
  172. resource 'rstr' (kCollectionInfoPage+kDETRecordType, purgeable) {
  173.     "Album Collection"
  174. };
  175.  
  176. resource 'rstr' (kCollectionInfoPage+kDETInfoPageName, purgeable) {
  177.     "Album Collection"
  178. };
  179.  
  180. resource 'rstr' (kCollectionInfoPage+kDETInfoPageMainViewAspect, purgeable) {
  181.     "Album Collection Aspect"
  182. };
  183.  
  184. resource 'detv' (kCollectionInfoPage, purgeable)
  185.     {
  186.     {
  187.     {kPageBitmapTop, kPageBitmapLeft, kPageBitmapBottom, kPageBitmapRight}, kDETNoFlags, kDETAspectMainBitmap,
  188.     Bitmap { kDETSmallIcon };
  189.  
  190.     {sublistTopBound-1, sublistLeftBound-1, sublistBottomBound+1, sublistRightBound+1}, kDETNoFlags, kDETNoProperty,
  191.         Box { kDETUnused };
  192.  
  193.     {sublistTitleTop, sublistLeftBound+nameColumnLeft, sublistTitleBottom, sublistLeftBound+nameColumnRight},
  194.         kDETNoFlags, kDETPrName,
  195.         StaticCommandTextFromView { kGeneva, 9, kDETLeft, kDETUnderline, "Name", kDETChangeViewCommand, -1 };
  196.  
  197.     {sublistTitleTop, sublistLeftBound+kindColumnLeft, sublistTitleBottom, sublistLeftBound+kindColumnRight},
  198.         kDETNoFlags, kDETPrKind,
  199.         StaticCommandTextFromView { kGeneva, 9, kDETLeft, kDETNormal, "Kind", kDETChangeViewCommand, -2 }; 
  200.     };
  201.     };
  202.  
  203. resource 'detv' (kCollectionInfoPage + 1, purgeable)
  204.     {
  205.     {
  206.     {sublistIconTop, iconColumnLeft, sublistIconBottom, iconColumnRight},
  207.         kDETHilightIfSelected, kDETAspectMainBitmap,
  208.         Bitmap { kDETMiniIcon };
  209.  
  210.     {sublistTextTop, nameColumnLeft, sublistTextBottom, nameColumnRight},
  211.         kDETHilightIfSelected + kDETDynamicSize, kDETPrName,
  212.         StaticText { kGeneva, 9, kDETLeft, kDETIconStyle };
  213.  
  214.     {sublistTextTop, kindColumnLeft, sublistTextBottom, kindColumnRight},
  215.         kDETNoFlags, kDETPrKind,
  216.         StaticText { kGeneva, 9, kDETLeft, kDETNormal };
  217.     }
  218.     };
  219.